/*
 * CS_CPI_REQUEST.cpp
 *
 *  Created on: 2013. 12. 3.
 *      Author: mega
 */

#include "../../Command.h"
#include "../../User.h"
#include "../../NProcess/Static.h"

namespace ProjectZ { namespace NCommand {

void Command::CS_CPI_REQUEST(User * pUser, ::Network::Packet * pPacket)
{
	PREPARE_PACKET;

	Toolkit::Str<4096> json;

	*pPacket >> json;

	// CPI는 Async로 수행되기 때문에 User 객체가 사라지지 않도록 Ref카운트 증가
	pUser->IncreaseRefCount();

	NProcess::CPISender::Param param;
	param._user = pUser;
	param._json = json.c_str();

	NProcess::Static::InstancePtr()->GetCPISender().Push(param);
}

} /*NCommand*/ } /*ProjectZ*/
